﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WMSSoft.Lib.Enums;

namespace WMSSoft.Lib.Basic.Attributes
{
    [AttributeUsageAttribute(AttributeTargets.Class, AllowMultiple=true, Inherited=true)]
    public class DSClassAttributeOptionAttribute : Attribute
    {
        /// <summary>
        /// Setting-Name
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// Caption for this settings
        /// </summary>
        public string Caption { get; set; }

        /// <summary>
        /// Default Value for this Setting
        /// </summary>
        public string Default { get; set; }

        /// <summary>
        /// Data-Type for this Option
        /// </summary>
        public OptionValueType Type { get; set; }

        /// <summary>
        /// List with Values to select, separate it with a "|"
        /// </summary>
        public string AvailableValues { get; set; }

        /// <summary>
        /// Minimum length for a Text-Value if Type is otText use 0 if this is not needed
        /// </summary>
        public int MinTextLength { get; set; }

        /// <summary>
        /// Maximum length for a Text-Value if Type is otText use 0 if this is not needed
        /// </summary>
        public int MaxTextLength { get; set; }
        /// <summary>
        /// Minimum Value if Data-Type is Numeric (without decimal places)
        /// </summary>
        public int MinNumericValue { get; set; }

        /// <summary>
        /// Maximum Value if Data-Type is Numeric (without decimal places)
        /// </summary>
        public int MaxNumericValue { get; set; }

        /// <summary>
        /// Minimum Value if Data-Type is NumericDouble 
        /// </summary>
        public double MinDoubleNumericValue { get; set; }

        /// <summary>
        /// Maximum Value if Data-Type is NumericDouble
        /// </summary>
        public double MaxDoubleNumericValue { get; set; }

        public DSClassAttributeOptionAttribute(string sName, string sCaption, string sDefault, OptionValueType oType)
        {
            Name = sName;
            Caption = sCaption;
            Default = sDefault;
            Type = oType;
        }
    }
}
